#ifndef PLUGINMANAGER_H
#define PLUGINMANAGER_H

#include <QObject>
#include "global.h"
#include "configmanager.h"
#include <QDir>
#include <QFileInfoList>
#include "utils.h"

/**
 * 插件管理器，单例模式
 */
class PluginManager
{
private:
    static PluginManager instance;

    PluginManager();
    ~PluginManager(){};
    PluginManager(const PluginManager&)=delete;
    PluginManager& operator=(const PluginManager&)=delete;

public:
    static PluginManager& getInstance() {
        return instance;
    }

    // 从文件系统加载插件
    void loadPlugins();
    const QVector<PluginInfo> & getPlugins(){return plugins;};  // 可以获取，不能添加，只能加入到文件中然后重新加载

private:
    QVector<PluginInfo> plugins;

};

#endif // PLUGINMANAGER_H
